<template>
  <div>
    <table class="my-table">
      <thead>
        <tr>
          <slot name="head">
            <th>编号</th>
            <th>图片</th>
            <th>名称</th>
            <th width="100px">标签</th>
          </slot>
        </tr>
      </thead>
      <tbody>
        <tr v-for="item in goods" :key="item.id">
          <slot name="body" :row="item"></slot>
        </tr>
      </tbody>
    </table>
  </div>
</template>

<script>
export default {
  name: "MyTable",
  components: {},
  props: {
    goods:{
        type:Array,
        default:()=>[],
    }
  },
  data() {
    return {
    };
  },
  computed: {},
  watch: {},
  created() {},
  methods: {},
};
</script>

<style scoped lang="less">
.my-table {
  width: 100%;
  border-spacing: 0;
  img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    vertical-align: middle;
  }
  th {
    background: #f5f5f5;
    border-bottom: 2px solid #069;
  }
  td {
    border-bottom: 1px dashed #ccc;
  }
  td,
  th {
    text-align: center;
    padding: 10px;
    transition: all 0.5s;
    &.red {
      color: red;
    }
  }
  .none {
    height: 100px;
    line-height: 100px;
    color: #999;
  }
}
</style>
